home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-11
/
butt01.zip
/
MSGERROR.PRG
< prev
next >
Wrap
Text File
|
1993-01-04
|
3KB
|
91 lines
*:*********************************************************************
*:
*: Program: MSGERROR.PRG
*:
*: System: MIS Consulting
*: Author: Charles Alan Butler
*: Copyright (c) 1989, Charles Alan Butler
*: Last modified: 09/11/89 18:44
*:
*: Called by: GET_LINE
*: : CMDQ2.PRG
*: : BID_SEL.PRG
*: : JOBBID
*: : CMDQ.PRG
*: : JOBMEMO.PRG
*: : SERMEMO.PRG
*: : BIDMEMO.PRG
*:
*: Documented 09/17/89 at 16:40 SNAP! version 3.12f
*:*********************************************************************
** prg to display a message
PARAMETERS MsgColor,MsgRow,MsgTxt
** MsgColor = "<Text / Background>"
** Do MsgError WITH MsgColor,MsgRow,MsgTxt
** Requires variable 'wt' which is the WaitTime for delays, etc. (wt=90)
IF TYPE('WT') = 'U'
wt = 90
ENDIF
IF TYPE('SSpeed') # 'N'
SSpeed = 3 && Requires System Speed variable to control message rate
ENDIF
PRIVATE LeftCol,RightCol,TmpColor,InvColor,FlowColor,FlowDir,LC,OldRow,OldCol
TmpColor = SYS(2001,'COLOR') && Save Color
InvColor = SUBSTR(MsgColor,AT('/',MsgColor)+1) +'/'+LEFT(MsgColor,AT('/',MsgColor)-1)
OldRow = ROW() && Save row and col position
OldCol = COL()
DO CASE
CASE LEN(MsgTxt) = 0
MsgTxt = 'Error - No message specified????'
CASE LEN(MsgTxt)>80
MsgTxt = LEFT(MsgTxt,80)
CASE LEN(MsgTxt)<67
MsgTxt = 'Error !! '+MsgTxt
ENDCASE
MsgTxt = SPACE(40-LEN(MsgTxt)/2)+MsgTxt
MsgTxt = MsgTxt+SPACE(80-LEN(MsgTxt))
?? CHR(7)
SET COLOR TO &InvColor
@ MsgRow,0 SAY SYS(2002) && Hide Cursor
@ MsgRow,0 SAY MsgTxt
LeftCol = 0
FlowDir = 1
cnt1 = wt/5 && adjust message display time
DO WHILE cnt1 > 0
lc = IIF(FlowDir=1,0,79)
FlowColor = IIF(FlowDir=1,MsgColor,InvColor)
SET COLOR TO &FlowColor
DO WHILE lc >= 0 .AND. lc < 80
@ MsgRow,lc SAY SUBSTR(MsgTxt,lc+1,1)
cnt2 = SSpeed && adjust travel rate
DO WHILE cnt2 > 0
IF INKEY() > 0 .OR. cnt1 < 0
cnt1 = -1
EXIT
ENDIF
cnt2 = cnt2-1
ENDDO
lc = lc+FlowDir
ENDDO
FlowDir = IIF(FlowDir=1,-1,1)
cnt1 = cnt1-1
ENDDO
*************************************************************
SET COLOR TO &TmpColor
@ MsgRow,0
@ OldRow,OldCol SAY SYS(2002,1) && Restore Cursor & reposition
RETURN
*: EOF: MSGERROR.PRG